/*
 * @Author: sbotlp
 * @Email: sbotlp@sina.com
 * @Date: 2019-06-29 17:28:42
 * @LastEditTime: 2019-06-30 10:30:00
 * @Description: http://www.sbotlp.com.cn
 */
import { message } from 'antd';
import * as Actions from '../actions/Bullet.actions';
import { StoreState } from '../stateTypes/Bullet.type';
import * as Constants from '../constants/ConstantsTypes';
const initState = {
  bulletNumber: 0
};
export function Bullet(state: StoreState = initState, action: Actions.BulletAction): StoreState {
  switch (action.type) {
    case Constants.ADD_BULLET_NUMBER:
    return {
      ...state,
      bulletNumber: action.body
    }
    case Constants.BATCH_ADD_BULLET_NUMBER:
    return {
      ...state,
      bulletNumber: action.body
    }
    case Constants.USE_BULLET_NUMBER:
    return {
      ...state,
      bulletNumber: action.body
    }
    case Constants.BATCH_USE_BULLET_NUMBER:
    return {
      ...state,
      bulletNumber: action.body
    }
    default:
      return state;
  }
}